import Vue from 'vue'
import App from './App.vue'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import router from './router'

//添加路由守卫  过滤登录
// router.beforeEach((to, from , next) => {
//   var requiresAuth =to.matched.some((record) => {
//       return record.meta.requiresAuth
//   })
//   if(requiresAuth){
//     if(localStorage.token){
//       next();
//     }
//     else{
//       next({
//         path:'/Login'
//       });
//     }
//   }else{
//     next();
//   }
// });

import store from './store'

Vue.config.productionTip = false

import axios from './request'
Vue.prototype.$http =  axios;


Vue.prototype.ShowMsg = function(msg,type='info',title="系统提示"){
  this.$notify({
      type:type,
      title: title,
      message: msg
  });
};

new Vue({
  router:router,
  store:store,
  render: h => h(App),
}).$mount('#app')
